import math
import itertools
from Utils import is_square

STEP = 17.944271
def _h(a,b):
    return math.sqrt(b*b - (a/2)*(a/2))

def h(a):
    if is_square((a+1)*(a+1) + (a/2)*(a/2)):
        return (a+1)*(a+1) + (a/2)*(a/2)
    if is_square((a-1)*(a-1) + (a/2)*(a/2)):
        return (a-1)*(a-1) + (a/2)*(a/2)

def run():
    c = 1
    s = 0
    a = 16
    while c < 12:
        l = h(a)
        if l is not None:
            print a,math.sqrt(l)
            c += 1
            a *= 18
            a += 16 - a%16
        else:
            a -= 16


def stats():
    l = [16, 272, 4896, 87840, 1576240, 28284464, 507544128, 9107509824, 163427632720, 2932589879120]
    for i in range(len(l) - 1):
        print float(l[i+1])/l[i]
#stats()
run()

#16 17.0
#272 305.0
#4896 5473.0
#87840 98209.0
#1576240 1762289.0
#28284464 31622993.0
#507544128 567451585.0
#9107509824 10182505537.0
#163427632720 1.82717648081e+11
#2932589879120 3.27873515992e+12
